package mogiksaop.qliphoth.common.core;

import mogiksaop.qliphoth.common.lib.LibMisc;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import mogiksaop.qliphoth.client.lib.LibResources;
import mogiksaop.qliphoth.common.Qliphoth;
import mogiksaop.qliphoth.common.blocks.ModBlocks;
import mogiksaop.qliphoth.common.items.ItemMod;
import mogiksaop.qliphoth.common.items.ModItems;
import mogiksaop.qliphoth.common.lib.LibMisc;

import javax.annotation.Nonnull;

public final class QliphothCreativeTab extends CreativeTabs {

	public static final QliphothCreativeTab INSTANCE = new QliphothCreativeTab();
	NonNullList<ItemStack> list;

	public QliphothCreativeTab() {
		super(LibMisc.MOD_ID);
		//setNoTitle();
		//setBackgroundImageName(LibResources.GUI_CREATIVE);
	}


	/*@Override
	public boolean hasSearchBar() {
		return true;
	}*/

	@Override
	public ItemStack createIcon() {
		return new ItemStack(ModItems.pointForest);
	}

	@Override
	public void displayAllRelevantItems(@Nonnull NonNullList<ItemStack> list) {
		this.list = list;

		addItem(ModItems.dynamicPointBinary);
		addItem(ModItems.dynamicPointForest);
		addItem(ModItems.zefraSteel);
		
		addItem(ModItems.colorlessSoul);
		addItem(ModItems.qliphortGenius);
		addItem(ModItems.qliphortScoutSoul);
		addItem(ModItems.qliphortMonolithSoul);
		addItem(ModItems.qliphortHelixSoul);
		addItem(ModItems.qliphortCarrierSoul);
		addItem(ModItems.qliphortShellSoul);
		addItem(ModItems.qliphortDiskSoul);
		addItem(ModItems.qliphortCephalopodSoul);
		addItem(ModItems.qliphortStealthSoul);

		addBlock(ModBlocks.singleNodeCore);
		addBlock(ModBlocks.multiNodeCore);
		addBlock(ModBlocks.optimalStarterDevice);
		addBlock(ModBlocks.zefrasteelOre);

		/*addBlock(ModBlocks.flower);
		addBlock(ModBlocks.specialFlower);
		addItem(ModItems.petal);
		addItem(ModItems.pestleAndMortar);
		addItem(ModItems.dye);
		addItem(ModItems.fertilizer);
		addItem(ModItems.flowerBag);
		addItem(ModItems.blackLotus);
		addItem(ModItems.twigWand);
		addItem(ModItems.obedienceStick);
		addItem(ModItems.manaResource);
		addBlock(ModBlocks.storage);
		addItem(ModItems.manaCookie);
		addItem(ModItems.rune);*/

	}

	private void addItem(Item item) {
		item.getSubItems(this, list);
	}

	private void addBlock(Block block) {
		ItemStack stack = new ItemStack(block);
		block.getSubBlocks(this, list);
	}

}